﻿using System;
using System.Text;
using System.Data;
using System.Data.Common;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.Data.Schema.UnitTesting;
using Microsoft.Data.Schema.UnitTesting.Conditions;

namespace SSISDBExtensions.Test
{
    [TestClass()]
    public class PutETLJobStage : DatabaseTestClass
    {

        public PutETLJobStage()
        {
            InitializeComponent();
        }

        [TestInitialize()]
        public void TestInitialize()
        {
            base.InitializeTest();
        }
        [TestCleanup()]
        public void TestCleanup()
        {
            base.CleanupTest();
        }

        [TestMethod()]
        public void PutETLJobStage_Create()
        {
            DatabaseTestActions testActions = this.PutETLJobStage_CreateData;
            // Execute the pre-test script
            // 
            System.Diagnostics.Trace.WriteLineIf((testActions.PretestAction != null), "Executing pre-test script...");
            ExecutionResult[] pretestResults = TestService.Execute(this.PrivilegedContext, this.PrivilegedContext, testActions.PretestAction);
            // Execute the test script
            // 
            System.Diagnostics.Trace.WriteLineIf((testActions.TestAction != null), "Executing test script...");
            ExecutionResult[] testResults = TestService.Execute(this.ExecutionContext, this.PrivilegedContext, testActions.TestAction);
            // Execute the post-test script
            // 
            System.Diagnostics.Trace.WriteLineIf((testActions.PosttestAction != null), "Executing post-test script...");
            ExecutionResult[] posttestResults = TestService.Execute(this.PrivilegedContext, this.PrivilegedContext, testActions.PosttestAction);
        }
        [TestMethod()]
        public void PutETLJobStage_UpdateOrder()
        {
            DatabaseTestActions testActions = this.PutETLJobStage_UpdateOrderData;
            // Execute the pre-test script
            // 
            System.Diagnostics.Trace.WriteLineIf((testActions.PretestAction != null), "Executing pre-test script...");
            ExecutionResult[] pretestResults = TestService.Execute(this.PrivilegedContext, this.PrivilegedContext, testActions.PretestAction);
            // Execute the test script
            // 
            System.Diagnostics.Trace.WriteLineIf((testActions.TestAction != null), "Executing test script...");
            ExecutionResult[] testResults = TestService.Execute(this.ExecutionContext, this.PrivilegedContext, testActions.TestAction);
            // Execute the post-test script
            // 
            System.Diagnostics.Trace.WriteLineIf((testActions.PosttestAction != null), "Executing post-test script...");
            ExecutionResult[] posttestResults = TestService.Execute(this.PrivilegedContext, this.PrivilegedContext, testActions.PosttestAction);
        }
        [TestMethod()]
        public void PutETLJobStage_AddSameStage()
        {
            DatabaseTestActions testActions = this.PutETLJobStage_AddSameStageData;
            // Execute the pre-test script
            // 
            System.Diagnostics.Trace.WriteLineIf((testActions.PretestAction != null), "Executing pre-test script...");
            ExecutionResult[] pretestResults = TestService.Execute(this.PrivilegedContext, this.PrivilegedContext, testActions.PretestAction);
            // Execute the test script
            // 
            System.Diagnostics.Trace.WriteLineIf((testActions.TestAction != null), "Executing test script...");
            ExecutionResult[] testResults = TestService.Execute(this.ExecutionContext, this.PrivilegedContext, testActions.TestAction);
            // Execute the post-test script
            // 
            System.Diagnostics.Trace.WriteLineIf((testActions.PosttestAction != null), "Executing post-test script...");
            ExecutionResult[] posttestResults = TestService.Execute(this.PrivilegedContext, this.PrivilegedContext, testActions.PosttestAction);
        }



        #region Designer support code

        /// <summary> 
        /// Required method for Designer support - do not modify 
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            Microsoft.Data.Schema.UnitTesting.DatabaseTestAction PutETLJobStage_Create_TestAction;
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PutETLJobStage));
            Microsoft.Data.Schema.UnitTesting.Conditions.NotEmptyResultSetCondition ETLJobStageNameMustExistInDB_AfterCreate;
            Microsoft.Data.Schema.UnitTesting.DatabaseTestAction PutETLJobStage_UpdateOrder_TestAction;
            Microsoft.Data.Schema.UnitTesting.Conditions.NotEmptyResultSetCondition ETLJobStageNameMustExistInDB_AfterUpdate;
            Microsoft.Data.Schema.UnitTesting.DatabaseTestAction PutETLJobStage_Create_PosttestAction;
            Microsoft.Data.Schema.UnitTesting.DatabaseTestAction PutETLJobStage_AddSameStage_TestAction;
            Microsoft.Data.Schema.UnitTesting.Conditions.NotEmptyResultSetCondition PutETLJobStage_AddSameStage;
            Microsoft.Data.Schema.UnitTesting.DatabaseTestAction PutETLJobStage_AddSameStage_PosttestAction;
            Microsoft.Data.Schema.UnitTesting.DatabaseTestAction PutETLJobStage_UpdateOrder_PosttestAction;
            Microsoft.Data.Schema.UnitTesting.DatabaseTestAction PutETLJobStage_AddSameStage_PretestAction;
            Microsoft.Data.Schema.UnitTesting.DatabaseTestAction PutETLJobStage_Create_PretestAction;
            Microsoft.Data.Schema.UnitTesting.DatabaseTestAction PutETLJobStage_UpdateOrder_PretestAction;
            this.PutETLJobStage_CreateData = new Microsoft.Data.Schema.UnitTesting.DatabaseTestActions();
            this.PutETLJobStage_UpdateOrderData = new Microsoft.Data.Schema.UnitTesting.DatabaseTestActions();
            this.PutETLJobStage_AddSameStageData = new Microsoft.Data.Schema.UnitTesting.DatabaseTestActions();
            PutETLJobStage_Create_TestAction = new Microsoft.Data.Schema.UnitTesting.DatabaseTestAction();
            ETLJobStageNameMustExistInDB_AfterCreate = new Microsoft.Data.Schema.UnitTesting.Conditions.NotEmptyResultSetCondition();
            PutETLJobStage_UpdateOrder_TestAction = new Microsoft.Data.Schema.UnitTesting.DatabaseTestAction();
            ETLJobStageNameMustExistInDB_AfterUpdate = new Microsoft.Data.Schema.UnitTesting.Conditions.NotEmptyResultSetCondition();
            PutETLJobStage_Create_PosttestAction = new Microsoft.Data.Schema.UnitTesting.DatabaseTestAction();
            PutETLJobStage_AddSameStage_TestAction = new Microsoft.Data.Schema.UnitTesting.DatabaseTestAction();
            PutETLJobStage_AddSameStage = new Microsoft.Data.Schema.UnitTesting.Conditions.NotEmptyResultSetCondition();
            PutETLJobStage_AddSameStage_PosttestAction = new Microsoft.Data.Schema.UnitTesting.DatabaseTestAction();
            PutETLJobStage_UpdateOrder_PosttestAction = new Microsoft.Data.Schema.UnitTesting.DatabaseTestAction();
            PutETLJobStage_AddSameStage_PretestAction = new Microsoft.Data.Schema.UnitTesting.DatabaseTestAction();
            PutETLJobStage_Create_PretestAction = new Microsoft.Data.Schema.UnitTesting.DatabaseTestAction();
            PutETLJobStage_UpdateOrder_PretestAction = new Microsoft.Data.Schema.UnitTesting.DatabaseTestAction();
            // 
            // PutETLJobStage_Create_TestAction
            // 
            PutETLJobStage_Create_TestAction.Conditions.Add(ETLJobStageNameMustExistInDB_AfterCreate);
            resources.ApplyResources(PutETLJobStage_Create_TestAction, "PutETLJobStage_Create_TestAction");
            // 
            // ETLJobStageNameMustExistInDB_AfterCreate
            // 
            ETLJobStageNameMustExistInDB_AfterCreate.Enabled = true;
            ETLJobStageNameMustExistInDB_AfterCreate.Name = "ETLJobStageNameMustExistInDB_AfterCreate";
            ETLJobStageNameMustExistInDB_AfterCreate.ResultSet = 1;
            // 
            // PutETLJobStage_UpdateOrder_TestAction
            // 
            PutETLJobStage_UpdateOrder_TestAction.Conditions.Add(ETLJobStageNameMustExistInDB_AfterUpdate);
            resources.ApplyResources(PutETLJobStage_UpdateOrder_TestAction, "PutETLJobStage_UpdateOrder_TestAction");
            // 
            // ETLJobStageNameMustExistInDB_AfterUpdate
            // 
            ETLJobStageNameMustExistInDB_AfterUpdate.Enabled = true;
            ETLJobStageNameMustExistInDB_AfterUpdate.Name = "ETLJobStageNameMustExistInDB_AfterUpdate";
            ETLJobStageNameMustExistInDB_AfterUpdate.ResultSet = 1;
            // 
            // PutETLJobStage_Create_PosttestAction
            // 
            resources.ApplyResources(PutETLJobStage_Create_PosttestAction, "PutETLJobStage_Create_PosttestAction");
            // 
            // PutETLJobStage_AddSameStage_TestAction
            // 
            PutETLJobStage_AddSameStage_TestAction.Conditions.Add(PutETLJobStage_AddSameStage);
            resources.ApplyResources(PutETLJobStage_AddSameStage_TestAction, "PutETLJobStage_AddSameStage_TestAction");
            // 
            // PutETLJobStage_AddSameStage
            // 
            PutETLJobStage_AddSameStage.Enabled = true;
            PutETLJobStage_AddSameStage.Name = "PutETLJobStage_AddSameStage";
            PutETLJobStage_AddSameStage.ResultSet = 1;
            // 
            // PutETLJobStage_AddSameStage_PosttestAction
            // 
            resources.ApplyResources(PutETLJobStage_AddSameStage_PosttestAction, "PutETLJobStage_AddSameStage_PosttestAction");
            // 
            // PutETLJobStage_UpdateOrder_PosttestAction
            // 
            resources.ApplyResources(PutETLJobStage_UpdateOrder_PosttestAction, "PutETLJobStage_UpdateOrder_PosttestAction");
            // 
            // PutETLJobStage_CreateData
            // 
            this.PutETLJobStage_CreateData.PosttestAction = PutETLJobStage_Create_PosttestAction;
            this.PutETLJobStage_CreateData.PretestAction = PutETLJobStage_Create_PretestAction;
            this.PutETLJobStage_CreateData.TestAction = PutETLJobStage_Create_TestAction;
            // 
            // PutETLJobStage_UpdateOrderData
            // 
            this.PutETLJobStage_UpdateOrderData.PosttestAction = PutETLJobStage_UpdateOrder_PosttestAction;
            this.PutETLJobStage_UpdateOrderData.PretestAction = PutETLJobStage_UpdateOrder_PretestAction;
            this.PutETLJobStage_UpdateOrderData.TestAction = PutETLJobStage_UpdateOrder_TestAction;
            // 
            // PutETLJobStage_AddSameStageData
            // 
            this.PutETLJobStage_AddSameStageData.PosttestAction = PutETLJobStage_AddSameStage_PosttestAction;
            this.PutETLJobStage_AddSameStageData.PretestAction = PutETLJobStage_AddSameStage_PretestAction;
            this.PutETLJobStage_AddSameStageData.TestAction = PutETLJobStage_AddSameStage_TestAction;
            // 
            // PutETLJobStage_AddSameStage_PretestAction
            // 
            resources.ApplyResources(PutETLJobStage_AddSameStage_PretestAction, "PutETLJobStage_AddSameStage_PretestAction");
            // 
            // PutETLJobStage_Create_PretestAction
            // 
            resources.ApplyResources(PutETLJobStage_Create_PretestAction, "PutETLJobStage_Create_PretestAction");
            // 
            // PutETLJobStage_UpdateOrder_PretestAction
            // 
            resources.ApplyResources(PutETLJobStage_UpdateOrder_PretestAction, "PutETLJobStage_UpdateOrder_PretestAction");
        }

        #endregion


        #region Additional test attributes
        //
        // You can use the following additional attributes as you write your tests:
        //
        // Use ClassInitialize to run code before running the first test in the class
        // [ClassInitialize()]
        // public static void MyClassInitialize(TestContext testContext) { }
        //
        // Use ClassCleanup to run code after all tests in a class have run
        // [ClassCleanup()]
        // public static void MyClassCleanup() { }
        //
        #endregion

        private DatabaseTestActions PutETLJobStage_CreateData;
        private DatabaseTestActions PutETLJobStage_UpdateOrderData;
        private DatabaseTestActions PutETLJobStage_AddSameStageData;
    }
}
